package com.andy.buyu.server.web.conf;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import com.andy.buyu.server.dao.DbBatch;
import com.andy.buyu.server.game.GameConf;
import com.andy.buyu.server.game.task.TimerManager;
import com.andy.buyu.server.socket.BuyuServer;

@Component
public class StartupListener implements ApplicationListener<ApplicationReadyEvent> {

    public void onApplicationEvent(ApplicationReadyEvent event) {
    	
    	// 初始化配置
    	GameConf.init();
    	
    	TimerManager.init();
    	
    	// 启动db线程
    	DbBatch.start(2);
    	
    	// 启动完成，开始接客
    	BuyuServer.ok();
    	
    }


}
